package com.designpattern.behave.authlink;


/**
 * @author chengze
 * @date 2022/12/2
 * @desc 责任链
 */
public abstract class AuthLink {

    private AuthLink nextNode;

    private String nodeName;

    public AuthLink(String nodeName) {
        this.nodeName = nodeName;
    }

    public AuthLink getNextNode(){
        return nextNode;
    }

    public String getNodeName() {
        return nodeName;
    }


    public AuthLink appendNextNode(AuthLink nextNode){
        this.nextNode = nextNode;
        return nextNode;
    }

    /**
     * 每个节点要执行的方法
     */
    public abstract boolean doAuth();
}
